package com.linghang.wusthelper.entity.primary;

import org.springframework.stereotype.Repository;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author origin
 * 教务处公告实体类
 */

public class Announcement {

    private int announcementId;

    private String announcementTitle;

    private Date announcementCreatetime;

    private String announcementUrl;

    private String content;

    public int getAnnouncementId() {
        return announcementId;
    }

    public void setAnnouncementId(int announcementId) {
        this.announcementId = announcementId;
    }

    public String getAnnouncementTitle() {
        return announcementTitle;
    }

    public void setAnnouncementTitle(String announcementTitle) {
        this.announcementTitle = announcementTitle;
    }

    public String getAnnouncementCreatetime() {

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        return sdf.format(announcementCreatetime);
    }

    public void setAnnouncementCreatetime(String announcementCreatetime) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        try {
            this.announcementCreatetime = sdf.parse(announcementCreatetime);
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }

    public String getAnnouncementUrl() {
        return announcementUrl;
    }

    public void setAnnouncementUrl(String announcementUrl) {
        this.announcementUrl = announcementUrl;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Announcement() {
    }

    public Announcement(int announcementId, String announcementTitle,Date announcementCreatetime, String announcementUrl, String announcementContent) {
        this.announcementId = announcementId;
        this.announcementTitle = announcementTitle;
        this.announcementCreatetime = announcementCreatetime;
        this.announcementUrl = announcementUrl;
        this.content = announcementContent;
    }
}
